package com.xidian.zhiancloud.controller.emergencyManagement;

import com.xidian.zhiancloud.controller.base.BaseController;
import com.xidian.zhiancloud.dto.ResultDTO;
import com.xidian.zhiancloud.enums.GeneralResponseEnums;
import com.xidian.zhiancloud.service.emergencyManagement.EmergencyDrillRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/EmergencyDrillStatistics")
public class EmergencyDrillStatistics extends BaseController {
    @Autowired
    private EmergencyDrillRecordService emergencyDrillRecordService;

    @GetMapping("/type2")
    public ResultDTO type2(@RequestParam(value = "organizationId", required = false) Long id,
                           @RequestParam(value = "startTime",required = false) Date startTime,
                           @RequestParam(value = "endTime",required = false) Date endTime
                          ) {
        Long companyId  = getSessionUserCompanyId();
        return ResultDTO.successOf(emergencyDrillRecordService.type2(id, startTime, endTime, companyId), GeneralResponseEnums.SUCCESS);
    }

    @GetMapping("/type3")
    public ResultDTO type2(@RequestParam(value = "startTime",required = false) Date startTime,
                           @RequestParam(value = "endTime",required = false) Date endTime) {
        Long companyId  = getSessionUserCompanyId();
        return ResultDTO.successOf(emergencyDrillRecordService.type3(startTime, endTime, companyId), GeneralResponseEnums.SUCCESS);
    }

}
